//
//  YWAttendanceManager.h
//  maintain
//
//  Created by 郑想 on 16/2/22.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWSingleton.h"
#import <Foundation/Foundation.h>
#import "YWAttendanceRecord.h"

typedef NS_ENUM(NSInteger, YWAttendanceOperateType) {
    YWAttendanceOperateTypeCanArrive = 0, //能操作上班
    YWAttendanceOperateTypeCanLeave = 1, //能操作下班
    YWAttendanceOperateTypeNoAll = 2 //都不能操作
};

static NSString *const KUpdateAttendanceUploadStatusNotification = @"KUpdateAttendanceUploadStatusNotification";

@class YWPatrolPicture;
@interface YWAttendanceManager : NSObject
YWSingletonH(Manager)
//    - (YWAttendanceOperateType)attendanceOperateType;
- (YWAttendanceRecord*)newestAttendanceRecord;
- (BOOL)updateAttendanceRecordWithRecord:(YWAttendanceRecord*)attendanceRecord;
- (NSArray*)attendanceRecordWithPage:(NSInteger)page;
//提交签到、签退
- (void)submitAttendanceRecord:(YWAttendanceRecord*)record pistures:(NSArray*)pictures completeBlock:(void (^)(BOOL))complete;
//提交之前提交失败的签到、签退
//- (void)uploadFailAttendanceInfo;
/**
 *  获取上传失败的签到记录
 *
 *  @return 签到模型数组
 */
- (NSArray*)attendanceRecordWithUploadStatusFail;
/**
 *  修改签到记录的状态
 *
 *  params recordId
 */
- (BOOL)updateAttendanceUploadStatus:(NSInteger)uploadStatus withAttendanceRecordId:(NSString*)recordId;
/**
 *  更新签到记录
 *
 *  params recordId
 */
- (BOOL)updateAttendance:(YWAttendanceRecord*)attendance withRecordId:(NSString*)recordId;
/**
 *  更新签到表，数组更新
 *
 *  @param attendanceRecordArray 数组
 *
 *  @return 结果
 */
- (BOOL)updateAttendanceRecordWithAttendRecordArray:(NSArray*)attendanceRecordArray;
- (void)getAttendanceRecordWithAttendanceRecordId:(NSString*)attendanceRecordId WithComplete:(void(^)(YWAttendanceRecord *record))complet;
- (void)getAboutMeAttendanceWithPage:(NSInteger)page pageSize:(NSInteger)pageSize WithComplete:(void (^)(BOOL success))complete;
//- (NSString*)showTimeStrWithRecord:(YWAttendanceRecord*)attendanceRecord;
//- (NSString*)showStatusStrWithRecord:(YWAttendanceRecord*)attendanceRecord;
@end
